package com.tentact.servlets;

import com.tentact.service.MeetingService;
import com.tentact.vo.MeetingRoom;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "SelectByroomidServlet", value = "/SelectByroomidServlet")
public class SelectByroomidServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        int roomid = Integer.parseInt(request.getParameter("roomid"));
        MeetingService service = new MeetingService();
        MeetingRoom room = service.selectByRoomid(roomid);
        request.setAttribute("room",room);
        request.getRequestDispatcher("roomdetails.jsp").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request,response);
    }
}
